<?php

namespace app\admin\validate;

use think\Validate;

class LoginValidate extends Validate
{
    protected $rule = [
        'username' => 'require|max:25',
        'password' => 'require|max:25',
        //'code' => 'require|captcha',
    ];
    protected $message = [
        'username.require' => '用户名不能为空',
        'username.max' => '用户名长度不能超过25个字符',
        'password.require' => '密码不能为空',
        'password.max' => '密码长度不能超过25个字符',
        'code.require' => '验证码不能为空',
        'code.captcha' => '验证码错误'
    ];
    protected $scene = [
        'login' => ['username', 'password', 'code'],
    ];
}